#include <bits/stdc++.h>
#define ll long long
using namespace std;

struct node
{
	ll da;
	int num;
};

const int N = 2e5+5;
ll a[N];
int c[N];
node b[N];

void qsort(int l, int r)
{
	int i=l, j=r;
	ll key  = b[(l+r)/2].da;
	while (i<=j)
	{
		while (b[i].da < key) i++;
		while (b[j].da > key) j--;
		if (i<=j)
		{
			swap(b[i],b[j]);
			i++, j--;
		}
	}
	if (l<j) qsort(l,j);
	if (i<r) qsort(i,r);
}

int main()
{
	int n,t;
	freopen("sort.in","r",stdin);
	freopen("sort.out","w",stdout);
	scanf("%d %d",&n,&t);
	for (int i=1; i<=n; i++) 
	{
		scanf("%d",&a[i]);
		b[i].da = a[i];
		b[i].num = i;
	}
	qsort(1,n);
	for (int i=1; i<=n; i++) c[b[i].num] = i;
	while (t--)
	{
		int op,x,v;
		scanf("%d",&op);
		if (op == 1)
		{
			scanf("%d %d",&x,&v);
			a[x] += v;
			for (int i=1; i<=n; i++) 
			{
				b[i].da = a[i];
				b[i].num = i;
			}
			qsort(1,n);
			for (int i=1; i<=n; i++) c[b[i].num] = i;
		}
		else
		{
			scanf("%d",&x);
			printf("%d\n",c[x]);
		}
	}
	fclose(stdin);
	fclose(stdout);
	return 0;
}

